package com.demo.controller;

import com.demo.ResponseResult;
import com.demo.domain.entity.LogisticsLogin;
import com.demo.service.LogisticsLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin("*")
public class UserController {
    @Autowired
    private LogisticsLoginService logisticsLoginService;
    @PostMapping("/login")
    public ResponseResult login(@RequestBody LogisticsLogin logisticsLogin){
        return logisticsLoginService.login(logisticsLogin);
    }
    @PostMapping("/register")
    public ResponseResult register(@RequestBody LogisticsLogin logisticsLogin){
        return logisticsLoginService.register(logisticsLogin);
    }
    @PostMapping("/logout")
    public ResponseResult logout(){
        return logisticsLoginService.logout();
    }
}
